import gulp from 'gulp';
import gulpif from 'gulp-if';
import livereload from 'gulp-livereload';
import args from './util/args';

gulp.task('pages',()=>{
  return gulp.src('app/views/**/*.jade')
    .pipe(gulpif(args.watch,livereload()))
})

gulp.task('browser',(cb)=>{
  if(!args.watch) return cb();
  gulp.watch(['static/js/*.js','static/index.js'],['scripts']);
  gulp.watch('app/views/**/*.jade',['pages']);
  gulp.watch('static/less/*.less',['less']);
});